<%--
  Created by IntelliJ IDEA.
  systemParam: lichengming
  Date: 2017/6/15
  Time: 下午12:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>参数管理</title>

    <script type="text/javascript">
        function systemParamSave() {
            var result = false;
            $.emsAjax({
                url:"/ems/param/save",
                data:{
                    name:$("#name").val(),
                    pkey:$("#key").val(),
                    pvalue:$("#pvalue").val(),
                    to_client:$('input:radio:checked').val(),
                    remark:$("#remark").val(),
                    id:"${systemParam.id}"
                },
                success:function(resp) {
                    if (resp.status == "000") {
                        result = true;
                        $.alert(resp.message);
                    }else $.errorAlert(resp.message);
                }
            });
            return result;
        }

        if('${systemParam.id}'){
            $("input:radio[value=${systemParam.to_client}]").attr("checked",true);
        }
    </script>
</head>
<body>
<form class="form-horizontal">

    <div class="form-group">
        <label for="name" class="col-sm-4 control-label">名称：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control"
                   id="name" value="${systemParam.name}" placeholder="请输入名称" />
        </div>
    </div>

    <div class="form-group">
        <label for="key" class="col-sm-4 control-label">参数：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control"
                   id="key" value="${systemParam.pkey}" placeholder="请输入英文，驼峰标识，参数必须唯一" />
        </div>
    </div>

    <div class="form-group">
        <label for="pvalue" class="col-sm-4 control-label">参数值：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control"
                   id="pvalue" value="${systemParam.pvalue}" placeholder="请输入参数值" />
        </div>
    </div>

    <div class="form-group">
        <label for="" class="col-sm-4 control-label">是否下发客户端：</label>
        <div class="col-sm-8">
            <label class="radio-inline">
                <input type="radio" name="to_client" checked="checked" value="1"> 是
            </label>
            <label class="radio-inline">
                <input type="radio" name="to_client" value="0"> 否
            </label>
        </div>
    </div>

    <div class="form-group">
        <label for="remark" class="col-sm-4 control-label">备注：</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="3" id="remark" placeholder="">${systemParam.remark}</textarea>
        </div>
    </div>
</form>
</body>
</html>